<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>发射机告警历史表</title>
    <link rel="stylesheet" th:href="@{../../component/pear/css/pear.css}"/>
</head>

<body class="pear-container">
<div class="layui-card">
    <div class="layui-card-body">
        <div class="col-sm-13 search-collapse">
            <form class="layui-form" id="formId">
                <div class="layui-form-item">
                    <label class="layui-form-label">台站ID：</label>
                    <div class="layui-input-inline">
                        <input class="layui-input"  name="stationCode" placeholder="请输入台站ID" type="text" lay-verify="required" />
                    </div>
                    <label class="layui-form-label" style="width: 7%">发射机ID：</label>
                    <div class="layui-input-inline">
                        <input class="layui-input" name="transCode" placeholder="请输入台站名称" type="text" lay-verify="required" />
                    </div>
                    <label class="layui-form-label" style="width: 7%">查询开始时间：</label>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" id="startTime"  name="startTime"  placeholder="yyyy-MM-dd HH:mm:ss" lay-verify="required"  >
                    </div>
                    <label class="layui-form-label" style="width: 7%">查询结束时间：</label>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" id="endTime"  name="endTime"  placeholder="yyyy-MM-dd HH:mm:ss"lay-verify="required" >
                    </div>
                    <button class="pear-btn pear-btn-md pear-btn-primary" lay-filter="myTable-query" lay-submit>
                        <i class="layui-icon layui-icon-search"></i>
                        查询
                    </button>
                    <button class="pear-btn pear-btn-md" type="reset">
                        <i class="layui-icon layui-icon-refresh"></i>
                        重置
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>
<div class="layui-card">
    <div class="layui-card-body">
        <table id="myTable" lay-filter="myTable"></table>
    </div>
</div>

<script th:src="@{../../component/layui/layui.js}"></script>
<script th:src="@{../../component/pear/pear.js}"></script>
<script>
    layui.use(['table', 'form', 'jquery', 'popup','laydate','element', 'util','layer'], function () {
        let table = layui.table;
        let form = layui.form;
        let $ = layui.jquery;
        let popup = layui.popup;
        let laydate = layui.laydate;
        let MODULE_PATH = "/system/transmitterlog/";

        laydate.render({
            elem: '#startTime',
            type: 'datetime',
            theme: 'grid',
            // value: getRecentDay(0),
        });

        laydate.render({
            elem: '#endTime',
            type: 'datetime',
            theme: 'grid',
            // value: getRecentDay(0),
        });

        form.on('submit(myTable-query)', function (data) {
            table.reload('myTable', {where: data.field})
            return false;
        });

        let cols = [
            [
                {
                    title: '台站ID',
                    field: 'stationCode',
                    align: 'center'
                },
                {
                    title: '发射机ID',
                    field: 'transCode',
                    align: 'center'
                },
                {
                    title: '日志时间',
                    field: 'logTime',
                    align: 'center',
                    templet: "<div>{{layui.util.toDateString(d.logTime)}}</div>"
                },
                {
                    title: '日志类型',
                    field: 'logType',
                    align: 'center',
                },
                {
                    title: '日志信息',
                    field: 'logDescription',
                    align: 'center',
                },
                {
                    title: '上报时间',
                    field: 'sendTime',
                    align: 'center',
                    templet: "<div>{{layui.util.toDateString(d.sendTime)}}</div>"
                }
            ]
        ]

        table.render({
            elem: '#myTable',
            url: MODULE_PATH +'data',
            page: true,
            cols: cols,
            skin: 'line',
            defaultToolbar: [],
            cellMinWidth: 'auto',
            done: function (res, curr, count) {
            }
        });

    })

</script>
</body>

</html>
